import React, { Component } from 'react';
import { Layout } from 'antd';
import Header from '../../components/header';
import SiderMenu from '../../components/sider';
import { connect } from 'react-redux';
import adminRoutes from '../../route/admin';
import '../../assets/sass/admin.scss';

const { Content } = Layout;

class Admin extends Component {
    render () {
        const { location: { pathname }, loginData } = this.props;
        return (
            <div className='app-admin'>
                <Header loginData={ loginData } />
                <div className='app-admin-content'>
                    <SiderMenu pathname={pathname}/>
                    {adminRoutes}
                </div>
            </div>
        );
    }
}
function select (state) {
    return {
        loginData: state.loginData,
    };
}
export default connect(select)(Admin);
